/// @tags:
#include <cstdio>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

constexpr int maxn = 2e5;

int a[maxn + 1];

int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "Yes" << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  std::sort(a + 1, a + n + 1);
  int pos = n / 2 + 2;
  const int mid = pos;
  --pos;
  while (pos >= 1 && a[pos] == a[mid]) {
    --pos;
  }
  int l = mid - pos - 1;
  pos = mid;
  ++pos;
  while (pos <= n && a[pos] == a[mid]) {
    ++pos;
  }
  int r = pos - mid;
  cout << ((l + r < mid - 1) ? "Yes" : "No") << endl;
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("A - .in", "r", stdin);
  freopen("A - .out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
